﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
public partial class SMSAPI : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
        if (!Page.IsPostBack)
        {
           
            bool result = true;
            if (Request.QueryString["mobiles"] != null && Request.QueryString["message"] != null)
            {
                string message = Request.QueryString["message"];
                string[] mobiles = Request.QueryString["mobiles"].Split(",".ToCharArray());
                foreach (string mobile in mobiles)
                {
                    if (Regex.Match(mobile.Trim(), @"[\d]{11}").Success)
                    {
                        if (!BLL.Message.CSFetionSingleton.DoubleSendSMS(mobile, message))
                            result = false;
                    }
                }

            }
            else
                result = false;
            Response.Write(result.ToString());
            Response.End();
        }
    }
}
